package com.lobo.blog.controller;

import com.lobo.blog.service.ArchivesService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @authoer:MacieSerenity
 * @createDate: 2022/10/15
 * @description:
 */
@Controller
public class ArchivesController {

    @Resource
    ArchivesService archivesService;

    @RequestMapping(value = "/archives", method = RequestMethod.GET)
    public String toArchives(Model model) {
        model.addAttribute("archiveMap", archivesService.archivesBlog());
        model.addAttribute("blogCount", archivesService.getBlogCount());
        return "archives";
    }
}
